from django.shortcuts import render
from django.http import HttpResponse
from .models import Song
from django.template.loader import get_template	
# Create your views here.

def homepage(requset):
	template = get_template('index.html')
	songs = Song.objects.all()
	html = template.render(locals())
	return HttpResponse(html)	

def showsong(request, song_name):
	template = get_template('song.html')
	song = Song.objects.get(song_name = song_name)
	html = template.render(locals())
	return HttpResponse(html)